<?php
/**
 * Created by PhpStorm.
 * User: changshuiwang
 * Date: 2016/7/27
 * Time: 11:36
 */


use yii\grid\GridView;
use yii\helpers\Html;



use backend\assets\AppAsset;
AppAsset::register($this);
//AppAsset::addJs($this,"/js/delete.js");
//AppAsset::addCss($this,Yii::$app->request->baseUrl."/css/b.css");

?>
<style>
    input[type="text"]{
        height:34px;
    }
    .row{
        margin-left: 0px;
    }
</style>
<script src="/js/jquery-1.9.1.min.js"></script>
<script src="/js/layer/layer.js"></script>
<script src="/js/delete.js"></script>
<div id="content">
    <div id="content-header">
        <div id="breadcrumb"> <a href="/site/index" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
            <a href="#" class="tip-bottom">info</a></div>
    </div>
    <div class="site-login">
        <h1><?= Html::encode($this->title) ?></h1>

        <p>Please fill out the following fields to login:</p>

        <div class="row">
            <div class="col-lg-5">
                <form id="login-form" method="get" role="form">

                    <div class="form-group field-searchform-username">
                        <label class="control-label" for="searchform-username">Username</label>
                        <input type="text" id="searchform-username" class="form-control" name="SearchForm[username]">

                        <p class="help-block help-block-error"></p>
                    </div>


                    <div class="form-group field-searchform-score">
                        <label class="control-label" for="searchform-score">Score</label>
                        <select id="searchform-score" class="form-control" name="SearchForm[score]">
                            <option value="0">请选择分数</option>
                            <option value="a">小于60分</option>
                            <option value="b">60-70分</option>
                            <option value="c">70-80分</option>
                            <option value="d">80-90分</option>
                            <option value="e">90分以上</option>
                        </select>

                        <p class="help-block help-block-error"></p>
                    </div>

                    <div><label style="display: inline-block;"><input type="radio" name="tag" value="0" checked=""> 全部</label>
                        <label style="display: inline-block;"><input type="radio" name="tag" value="1"> 已删除</label>
                        <label style="display: inline-block;"><input type="radio" name="tag" value="2"> 未删除</label>
                    </div>

                    <div class="form-group">
                        <button type="submit" class="btn btn-primary filter" name="login-button">Search</button>
                    </div>

                </form>
            </div>
        </div>
    </div>
    <p style="margin-left: 20px;"><a class="btn btn-lg btn-success" href="<?=Yii::$app->urlManager->createUrl('site/add')?>">添加</a></p>
    <?php
/*    echo GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            'id',
            'username',
            'score',
            [ 'header'=>'status','attribute' => 'tag','value' => function($model) {
                $tag=$model->tag;
                if($tag==1){
                    return "未删除";
                }else{
                    return "已删除";
                }
            }],
            [
                'attribute'=>'photo',
                'format' => ['image',['width'=>'80','height'=>'30',]],
                'value' => function($model){
                    return '@web/'.$model->photo;
                }
            ],
            [
                'class' => 'yii\grid\ActionColumn',
                'header' => '操作',
                'template' => '{delete}{update}{view}',
                'buttons' => [
                    'delete' => function ($url, $model, $key) {
                        return $model->tag == 1 ?
                            Html::a("<span class='glyphicon glyphicon-trash' url=$model->id></span>", "javascript:void(0)" ) : '';
                    },
                    'view' => function($url,$model){
                        return '<a href="javascript:void(0)"  title="View" aria-label="View" data-pjax="0">
                        <span class="glyphicon glyphicon-eye-open" url="'.$model->id.'"></span></a>';
                    }
                ],
            ],

        ]
    ]);*/
    ?>
</div>